Dynomotion

Group: DynoMotion Message: 8783 From: wgripp Date: 12/8/2013
Subject: TCC67 and hexadecimal literals
Hello,

I have been able to install my recently arrived Kflop+KAnalog and even made some test milling in my homemade, slaved, cnc router.

I am now approaching homing routines and another user of the Kflop kindly sent me the ones he has used in the past.

At a certain point of those routines I read:

ch0->LimitSwitchOptions = 0x0x880011;

I am more a Python programmer but the past I used to write C programs - still need to refresh my skills, but that doesn't look legit C to me.

In fact tcc67 cleanly compiles the following code while Lcc and Gcc don't:

void main(){
       int Limit;

       Limit = 0x0x880011;
}


To my eyes, tcc should find the 0x0 literal, but should complain about the undeclared x880011 identifier, shouldn't it ?

Thank you for any clarification.
Group: DynoMotion Message: 8784 From: wgripp Date: 12/8/2013
Subject: Re: TCC67 and hexadecimal literals

In particular, the gcc output follows:


gcc test.c -o test
test.c: In function ‘main’:
test.c:6:9: error: invalid suffix "x880011" on integer constant

Best regards
Group: DynoMotion Message: 8785 From: Tom Kerekes Date: 12/8/2013
Subject: Re: TCC67 and hexadecimal literals
Hi,

You are correct that is invalid C code and should generate an error but TCC67 doesn't.

Regards
TK

Group: DynoMotion Message: 8793 From: Tom Kerekes Date: 12/14/2013
Subject: Re: TCC67 and hexadecimal literals
Hi,

Here is a patch that should detect that error as "invalid character in constant"

http://dynomotion.com/Software/Patch/CompilerFlagsInvalidCharInConst/TCC67.exe

Please test it if possible.  Copy to your KMotion\Release directory. It should be compatible with most any Version.

Regards
TK


Group: DynoMotion Message: 8794 From: wgripp Date: 12/14/2013
Subject: Re: TCC67 and hexadecimal literals
Hello,

awesome and fast support !
Here's the new output in my Win7 64 bit, KMotion 4.30 and 4.31p:

C:\KMotion430\KMotion\Release>tcc67 test.c -o test.exe
test.c:5: unexpected character in constant


Thank you





---In DynoMotion@yahoogroups.com, <tk@...> wrote:

Hi,

Here is a patch that should detect that error as "invalid character in constant"

http://dynomotion.com/Software/Patch/CompilerFlagsInvalidCharInConst/TCC67.exe

Please test it if possible.  Copy to your KMotion\Release directory. It should be compatible with most any Version.

Regards
TK